Present day computer systems normally have an operating system, usually software interfacing with hardware, which functions to perform operations essential to the successful running of the computer system. The operating system for computer systems of the type incorporating the present invention have a storage management system which consists of complex software and hardware mechanisms. Computer systems of this type can perform multiprogramming and can include multiple tightly coupled parallel processors sharing a common main storage or memory. Because of this, the storage management system, for the successful operation of the computer system, must ensure that the common main storage is available for use without undue delay by the multiple programs and processors. One technique used by the storage management system to accomplish this is process or program swapping. When more programs or processes are in various states of execution than can be stored in main storage, the storage management system transfers one or more processes to a secondary storage device, called a swap device, such as disk storage or other type of mass storage, i.e. swapping out, and an executable process can be transferred from the swap device into main storage by the storage management system, i.e. swapping in.
Also, some operating systems have a storage management system which can do demand paging to facilitate multiprogramming. In such computer systems, the entire process or program does not have to reside in main storage to execute. The storage management system loads pages of a process on demand at the time the process references the required pages.
The present invention is incorporated in a computer system that does not have demand paging. The entire process to be executed must reside in main storage and remain therein until it becomes ineligible to execute. Therefore, while the storage management system of some computer systems can not perform demand paging to facilitate multiprogramming or the use of highly parallel multiprocessors sharing a common main storage, they can use process swapping. Some computer systems using swapping, such as Unix.TM..sup.1 System V, select swapout candidates according to their priority and residence time in main storage. The entire process image of the selected candidate is swapped out. In some instances the amount of free main storage space required for the process to be swapped in causes the swapping out of more than one process; however, using the same selection parameters. This results in greater swapping overhead and a less efficient and slower storage management system than the present invention because the present invention involves location and size when selecting swapout candidates. FNT 1. Unix is a trademark of AT&T Bell Laboratories
In the present invention in addition to a list of available memory segments, separate lists of allocated and of free memory spaces are provided. The available and allocated circular lists are disjoint lists of segments which together account for all of memory. These lists are ordered by size. A third circular list orders all of the segments, both allocated and available, by their location in memory. This enhances efficiency because segment size and location can now also be used as parameters when selecting swapout candidates.
Additionally, past storage management systems, such as the storage management system of UNIX System V did not have a data structure which embraced capabilities of the present invention such as segment splitting. The present invention improves the efficiency and speed of the storage management system by providing the segment splitting capability. Without the segment splitting capability, prior storage management systems had to swap out enough contiguous segments from main storage which would make room for the total size of the segment to be swapped in.
The shared image data structure of the present invention enables main storage management to perform its function for microprocessing which was also lacking in prior storage management systems.
The present invention is an improvement over such past storage management systems in that it selects the least number of the most inefficient processes as candidates for swapout. Additionally, the present invention provides for the swapping of a subset of the total process image, i.e. partial swapping. Partial swapping allows the mixing of pieces of very large processes in main storage with smaller processes. This is accomplished without causing undue system overhead such as in the past when large processes were completely swapped out. These improvements provide a more efficient and faster main memory management system.